//
//  YXBluetoothSetViewController.m
//  跑跑快销
//
//  Created by 杨潇 on 14-5-4.
//  Copyright (c) 2014年 ylife. All rights reserved.
//

#import "YXBluetoothSetViewController.h"

@interface YXBluetoothSetViewController ()

@end

@implementation YXBluetoothSetViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    YXBluetoothSetView * bluetoothSetVi = [[YXBluetoothSetView alloc] init];
    self.view = bluetoothSetVi;
    [bluetoothSetVi.searchBtn addTarget:self action:@selector(touchSearchBtn) forControlEvents:UIControlEventTouchUpInside];
}

- (void)touchSearchBtn
{
    _peerPicker = [[GKPeerPickerController alloc] init];
    _peerPicker.delegate = self;
    _peerPicker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;
    [_peerPicker show];
}

#pragma mark - GKPeerPickerControllerDelegate
- (void)peerPickerControllerDidCancel:(GKPeerPickerController *)picker
{
    _peerPicker.delegate = nil;
    _peerPicker = nil;
}

- (void)peerPickerController:(GKPeerPickerController *)picker didConnectPeer:(NSString *)peerID toSession:(GKSession *)session
{
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
